package cn.com.customer.manager.adapter

import cn.com.customer.manager.R
import cn.com.customer.manager.bean.MsgBean
import cn.com.customer.manager.bean.MsgPlayBean
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder
import com.xuexiang.xui.widget.imageview.RadiusImageView

class MegListAdapter(rid: Int) : BaseQuickAdapter<MsgPlayBean, BaseViewHolder>(rid) {
    override fun convert(helper: BaseViewHolder?, item: MsgPlayBean?) {
        helper?.let { hel ->
            val ivMsgType = helper?.getView(R.id.iv_msg_type) as RadiusImageView
            ivMsgType.setImageResource(R.drawable.instation_noti)
            item?.let {
        if ( it.receiveBean!=null){
            hel.setText(R.id.tv_msg_name, it.receiveBean?.receiveName+":"+it.receiveBean?.receiveMobile)
            hel.setText(R.id.tv_msg_desc, it.receiveBean?.smsContent)
            hel.setText(R.id.tv_time_msg, it.receiveBean?.sendDate)
            }else{
            hel.setText(R.id.tv_msg_name, it?.sendBean?.sendName+":"+it.sendBean?.sendMobile)
            hel.setText(R.id.tv_msg_desc, it?.sendBean?.smsContent)
            hel.setText(R.id.tv_time_msg, it?.sendBean?.sendDate)
        }
            }

        }
    }
}